package com.ruibang.glass.purchase.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 采购审批列表
 * </p>
 *
 * @author mameng
 * @since 2024-04-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "采购审批列表")
@TableName("g_purchase_approval_list")
public class PurchaseApprovalList extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "项目编号")
    private String number;

    @ApiModelProperty(value = "项目申请编号")
    private String applyNumber;

    @ApiModelProperty(value = "项目名称")
    private String projectName;

    @ApiModelProperty(value = "预计金额")
    private BigDecimal estimatedAmount;

    @ApiModelProperty(value = "申请人")
    private String applicant;

    @ApiModelProperty(value = "申请人")
    private String applicantId;

    @ApiModelProperty(value = "部门")
    private String deptId;

    @ApiModelProperty(value = "部门名称")
    private String deptName;

    @ApiModelProperty(value = "采购方式")
    private String purchaseMode;

    @ApiModelProperty(value = "申请时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime applyTime;

    @ApiModelProperty(value = "采购时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime purchaseTime;

    @ApiModelProperty(value = "项目介绍")
    private String projectIntroduce;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "合同Id")
    private String contractId;

    @ApiModelProperty(value = "合同名称")
    private String contractName;

    @ApiModelProperty(value = "项目类型: 1_采购立项 2_生产采购订单,3:框架合同")
    private String spStatus;

    @ApiModelProperty(value = "是否上传合同 1——未上传 2---上传")
    @TableField(exist = false)
    private String contractStatus;

    @TableField(exist = false)
    private List<PurchaseApprovalItems> purchaseApprovalItemsList;

    @TableField(exist = false)
    private List<PurchaseApprovalSupplier> purchaseApprovalSupplierList;

    @TableField(exist = false)
    private List<String> fileIds;

    @TableField(exist = false)
    @ApiModelProperty(value = "比价单文件")
    private List<String> priceFileIds;

    @ApiModelProperty(value = "菜单")
    @TableField(exist = false)
    private String menuId;


    @ApiModelProperty(value = "状态")
    @TableField(exist = false)
    private String status;

    @ApiModelProperty(value = "流程Id")
    @TableField(exist = false)
    private String processId;

    @ApiModelProperty(value = "审批状态")
    private String approveStatus;

    @ApiModelProperty(value = "审批节点")
    @TableField(exist = false)
    private String nodeName;

    @ApiModelProperty(value = "审批人")
    @TableField(exist = false)
    private String approveUser;

    @ApiModelProperty(value = "审批人")
    @TableField(exist = false)
    private String approveUserId;

    @ApiModelProperty(value = "创建人Id")
    @TableField(exist = false)
    private String createUserId;

    @ApiModelProperty(value = "供应商名称")
    private String supplierName;

    @ApiModelProperty(value = "供应商id")
    private String supplierId;

    @ApiModelProperty(value = "验收人")
    private String acceptanceUser;

    @ApiModelProperty(value = "验收人Id")
    private String acceptanceUserId;

    @ApiModelProperty(value = "收货地址")
    private String receivingAddress;

    @ApiModelProperty(value = "付款方式")
    private String payMethod;

    @ApiModelProperty(value = "提醒时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime reminderTime;

    @ApiModelProperty(value = "交货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deliveryTime;

    @ApiModelProperty(value = "联系方式")
    private String contactInformation;

    @ApiModelProperty(value = "废止 1_正常 2_废止")
    private String deleteStatus;

    @ApiModelProperty(value = "废止原因")
    private String deleteReason;

    @ApiModelProperty(value = "是否已审批完成0：未完成，1：已完成")
    private String isFinished;


    @ApiModelProperty(value = "呆滞时长")
    @TableField(exist = false)
    private String daysSinceUpdate;

    @ApiModelProperty(value = "是否已被合同使用:0未使用，1:已使用,默认为0")
    private String isUsed;

    @ApiModelProperty(value = "是否已在评标报告中使用:0未使用，1:已使用,默认为0")
    private String isReportUsed;
}
